SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


CREATE PROCEDURE dbo.DnnProduct_GetFile
	@FileName nvarchar(246),
	@FolderID int
AS
BEGIN
	SELECT FileId,
		   folders.PortalId,
		   [FileName],
		   Extension,
		   Size,
		   Width,
		   Height,
		   ContentType,
		   files.FolderID,
		   FolderPath AS 'Folder',
		   StorageLocation,
		   IsCached,
		   files.UniqueId,
		   files.VersionGuid,	   
		   files.SHA1Hash,
		   FolderMappingID,
		   LastModificationTime
	FROM dbo.[DnnProduct_Files] AS files
	INNER JOIN dbo.[DnnProduct_Folders] AS folders ON files.FolderID = folders.FolderID
	WHERE [FileName] = @FileName AND files.FolderID = @FolderID
END
GO
